package edu.hunan.cxb18.service.impl;

import edu.hunan.cxb18.mapper.CategoryMapper;
import edu.hunan.cxb18.pojo.Category;
import edu.hunan.cxb18.pojo.CategoryExample;
import edu.hunan.cxb18.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author AuthorName
 * @create 2020-04-25 20:26
 */
@Service
public class CategoryImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> findTopleveCategory() {
        CategoryExample categoryExample = new CategoryExample();
        CategoryExample.Criteria criteria = categoryExample.createCriteria();
        criteria.andPcidIsNull();
        return categoryMapper.selectByExample(categoryExample);
    }
}
